﻿using Microsoft.Extensions.DependencyInjection;
using StackExchange.Redis;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace chihuopig.Web.Framework
{
    public static class RedisExchange
    {
        public static void AddRedisDbdatabase(this IServiceCollection services,IDatabase dbredis)
        {
            var descriptor = new ServiceDescriptor(typeof(IDatabase), dbredis.GetType(), ServiceLifetime.Scoped);
            services.Add(descriptor);

        }
    }
}
